Learn R Programming

listArray (version 0.1.1)

[.listArray: Extract or Replace one Element of a listArray

Description

Operators acting on one element of a listArray to extract or replace it.

Usage

# S3 method for listArray
[(x, ...)

# S3 method for listArray [(x, ...) <- value

Arguments

x

object from which to extract a element or in which to replace a element.

...

indices specifying the element to extract or replace. Indices can consist of any R Object.

value

value which replaces a listArray element

Value

Returns or sets the selected element.

Examples

Run this code
# NOT RUN {
l <- listArray()
l[1] <- 1
l[1]
#
l[2,3] <- "test"
l[2,3]
#
l[2:3] <- "vector"
l[2:3]
l[2,3]
#
l['iris'] <- iris
head(l['iris'])
#
l[letters[1:5]] <- letters[1:5]
l[letters[1:5]]
#
l[mean] <- mean
l[mean](0:10)
# }

Run the code above in your browser using DataLab